from appium import webdriver
from time import sleep

def launch():
    desired_caps = {}
    desired_caps['platformName'] = "Android"
    desired_caps['platformVersion'] = '7.1.1'
    desired_caps['deviceName'] = '3HX5T17220012472'
    desired_caps['browserName'] = 'Chrome' # 利用手机浏览器测试 web， 这个是必须的
    desired_caps['unicodeKeyboard'] = "True"
    desired_caps['resetKeyboard'] = "True"
    driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
    driver.get('https://m.baidu.com')
    sleep(10)
    driver.quit()

if __name__ == '__main__':
    launch()